package com.xq.shop.service.user.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xq.shop.dao.IUserDAO;
import com.xq.shop.po.User;
import com.xq.shop.service.user.IUserService;

@Service("user_user_service")
public class UserService implements IUserService {

	@Autowired
	IUserDAO userDAO;

	@Override
	public void save(User user) {
		userDAO.save(user);
	}

	@Override
	public boolean usernameExists(String username) {
		
		return  userDAO.get(username) != null;
	}

	@Override
	public User get(String username) {
		
		return userDAO.get(username);
	}
	
	@Override
	public void update(User user){
		
		userDAO.update(user);
	}
}
